HTML - tutorial - 24 - SVG -descriptive elements

revision:


Content

<desc> <metadata> <title>


<desc>

top

Provides an accessible, long-text description of any SVG container element or graphics element. Text in a <desc> element is not rendered as part of the graphic. If the element can be described by visible text, it is possible to reference that text with the "aria-describedby" attribute. If "aria-describedby" is used, it will take precedence over <desc>.

The hidden text of a <desc> element can also be concatenated with the visible text of other elements using multiple IDs in an "aria-describedby" value. In that case, the <desc> element must provide an ID for reference.

Attributes: includes global attributes.

example
I'm a circle and that description is here to demonstrate how I can be described, but is it really necessary to describe a simple circle like me?

codes:

                    <svg viewBox="0 0 10 7">
                        <circle cx="5" cy="3" r="3">
                            <desc>I'm a circle and that description is here 
                            to  demonstrate how I can be described, but is it really 
                            necessary to describe a simple circle  like me? </desc>
                        </circle>
                    </svg>
                

<metadata>

top

Adds metadata to SVG content. Metadata is structured information about data. The contents of <metadata> should be elements from other XML namespaces such as RDF, FOAF, etc.

Attributes: includes global attributes


<title>

top

Provides an accessible, short-text description of any SVG container element or graphics element. Text in a <title> element is not rendered as part of the graphic, but browsers usually display it as a tooltip. If an element can be described by visible text, it is recommended to reference that text with an "aria-labelledby" attribute rather than using the <title> element.

Attributes: includes only global attributes

example
I'm a circle I'm a square

codes:

                    <svg viewBox="0 0 20 10">
                        <circle cx="5" cy="5" r="4">
                        <title>I'm a circle</title>
                        </circle>
                        <rect x="11" y="1" width="8" height="8">
                        <title>I'm a square</title>
                        </rect>
                    </svg>